package day0625;

import java.util.Arrays;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        int[]  a={1,6 , 3, 2};
        Scanner  s=new Scanner(System.in);
        System.out.println("请输入要删除的元素编号,范围是：0--"+(a.length-1) );
        int index=s.nextInt();
        //复制数组的每一位
        for(int i=index+1; i<a.length;i++){
            a[i-1]=a[i];
        }
        //复制数组
        a=Arrays.copyOf(a, a.length-1);
        //3.打印
        System.out.println(Arrays.toString(a));
    }
}
